package com.ciaojian.core.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ciaojian.core.model.HaloTitle;
import com.ciaojian.core.model.vo.HaloTitleVO;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * halo 支付标题 Mapper 接口
 * </p>
 *
 * @author Atlakyn
 * @since 2021-06-01
 */
public interface HaloTitleMapper extends BaseMapper<HaloTitle> {

    /**
     * 查询全部 halo 支付标题
     *
     * @return 未删除的 halo 支付标题
     * @see HaloDetailMapper#findAll(Integer)
     */
    @Select("SELECT * FROM d_halo_title WHERE del = FALSE ORDER BY sort")
    @Results(
            @Result(column = "id", property = "haloDetailList", many = @Many(select = "com.ciaojian.core.mapper.HaloDetailMapper.findAll"))
    )
    List<HaloTitleVO> findAll();

}
